//
//  UIview+Extension.swift
//  WeiboSourceCode
//
//  Created by 周星宇 on 15/12/26.
//  Copyright © 2015年 cn.weibo. All rights reserved.
//

import UIKit

/**
 *  XIB配置
 */
extension UIView {
    
    
    @IBInspectable var conerRadius:CGFloat {
        
        get {
            return layer.cornerRadius
        }
        set {
            
            layer.cornerRadius = newValue
            layer.masksToBounds = (newValue > 0)
        }
    }
    
    @IBInspectable var borderWidth:CGFloat {
        
        get {
            
            return layer.borderWidth
        }
        set {
            
            layer.borderWidth = newValue
        }
    }
    @IBInspectable var borderColor:UIColor? {
        
        get {
            
            guard let c = layer.borderColor else{
                
                return nil
            }
            return UIColor(CGColor: c)
        }
        set {
            
            layer.borderColor = newValue?.CGColor
        }
    }
    
    
}